<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>AbstractController::UrlFor</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Module</span> 
            AbstractController::UrlFor 
            
        </h1>
        <ul class="files">
            
            <li><a href="../../files/actionpack/lib/abstract_controller/url_for_rb.html">actionpack/lib/abstract_controller/url_for.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>Includes <code>url_for</code> into the host class (e.g. an abstract
controller or mailer). The class has to provide a <code>RouteSet</code> by
implementing the <code>_routes</code> methods. Otherwise, an exception will
be raised.</p>

<p>Note that this module is completely decoupled from HTTP - the only
requirement is a valid <code>_routes</code> implementation.</p>

    </div>
  


  


  
  


  
    <!-- Namespace -->
    <div class="sectiontitle">Namespace</div>
    <ul>
      
        <li>
          <span class="type">MODULE</span>
          <a href="UrlFor/ClassMethods.html">AbstractController::UrlFor::ClassMethods</a>
        </li>
      
    </ul>
  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>#</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="UrlFor.html#method-i-_routes">_routes</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  
    <!-- Includes -->
    <div class="sectiontitle">Included Modules</div>
    <ul>
      
        <li>
          
            <a href="../ActionDispatch/Routing/UrlFor.html">
              ActionDispatch::Routing::UrlFor
            </a>
          
        </li>
      
    </ul>
  



  

    

    

    


    


    <!-- Methods -->
        
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-_routes">
            
              <b>_routes</b>()
            
            <a href="UrlFor.html#method-i-_routes" name="method-i-_routes" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-_routes_source')" id="l_method-i-_routes_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/7c90d91c3c43bdbba25d38589aed0e2940af3bc8/actionpack/lib/abstract_controller/url_for.rb#L12" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-_routes_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/url_for.rb, line 12</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">_routes</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;In order to use #url_for, you must include routing helpers explicitly. &quot;</span>              <span class="ruby-string">&quot;For instance, `include Rails.application.routes.url_helpers&quot;</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    